import crypto from 'crypto';

export const md5 = (data, digest) => {
  const md5 = crypto.createHash('md5');
	md5.update(data);
	return md5.digest(digest);
};

export const hmac = (key, string, digest, fn) => {
  var hmac = crypto.createHmac(fn, key);
	hmac.update(string);
	return hmac.digest(digest);
};